package com.aliyuncs.aui.controller;

import com.aliyuncs.aui.service.DashscopeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/dashscope")
public class DashscopeController {

    @Autowired
    private DashscopeService dashscopeService;

    @GetMapping("/callOrder/{prompt}")
    public String callOrderModel(@PathVariable String prompt) {
        try {
            return dashscopeService.callOrderModel(prompt);
        } catch (Exception e) {
            return "Error: " + e.getMessage();
        }
    }
}
